var cache = {
    getUser:function(){
        return JSON.parse(localStorage.getItem("user"));
    },
    setUser:function(user){
        localStorage.setItem("user",JSON.stringify(user));
    },
    clearUser:function(){
        localStorage.removeItem("user");
    },
    setToken:function(token){
        localStorage.setItem("token",token);
    },
    getToken:function(){
        return localStorage.getItem("token");
    },
    clearToken:function(){
        return localStorage.removeItem("token");
    },
    isLogin:function(){
        if(localStorage.getItem("user")){
            return true;
        }
        return false;
    }
}



export default {
    cache
}
